package com.hou.hpsj_springboot.controller;

import com.hou.hpsj_springboot.bean.UserAndVideos_Ext;
import com.hou.hpsj_springboot.bean.Users;
import com.hou.hpsj_springboot.service.UserService;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;

@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    private UserService userService;
    @GetMapping("get")
    public ArrayList<Users> get(String email) {
        System.out.println(userService.get(email));
            return  userService.get(email);

    }
    @GetMapping("UserWork")
    public ArrayList<UserAndVideos_Ext> getUserWork(int id) {
        System.out.println(userService.getUserWork(id));
        return userService.getUserWork(id);

    }
    @PutMapping("update")
    public void update(@RequestBody Users users) {
        userService.update(users);
    }
}
